using UnityEngine;
using QFramework;

namespace QFramework.Monk
{
	public partial class EnemyNormal : EnemyBase
	{
		protected override void Move()
		{
			if (!AppStart.CheckGameState(GameState.GamePlaying))
			{
				return;
			}
			// 空指针检查
			if (Player.Default != null)
			{
				//方向
				var dir = (Player.Default.transform.position - this.transform.position).normalized;

				// 移动物体
				selfRigidbody2D.velocity = dir * mSpeed;
			}
			else
			{
				selfRigidbody2D.velocity = Vector2.zero;
			}
		}
	}
}
